<script type="text/javascript">
var successFun=function(res){
if(res.code==200){
	document.location.reload();
}else{
	alert('出错了，请重新尝试！');
}
}
$(document).ready(function() { 
	var updateOptions	= {dataType:'json',error:doError,success:doSuccess}
    $('#form').ajaxForm(updateOptions);
}); 
</script>
<script src="{$this->data['baseurl']}js/checkbox.js"></script>
<div id="content">
<div id="box">
<h3>热词管理 [<a href="{url('Hotkey','Edit',array('cid'=>$this->data['category_id']))}">添加热词</a>] 热词将会在类目的搜索列表页面显示</h3>
{if !empty($this->data['menuCategory'])}
<table width="100%">
<tr>
<td>
<a href="{url('Category','Index')}">所有类目</a>
<!--{loop $this->data['menuCategory'] $info}-->
&nbsp;>&nbsp;<a href="{url('Hotkey','Index',array('cid'=>$info['id']))}">{$info['name']}</a>
<!--{/loop}-->
</td>
</tr>
</table>
{/if}
<form id="form" method="post" action="{url('HotKey','SaveAll')}">
<table width="100%" class="admin-table">
<thead>
	<tr>
    	<th><a href="javascript:reverseCheckByName('id[]','hotkey')">ID</a></th>
    	<th>关键词</th>
    	<th>所在类目</th>
        <th>排序<img src="{$this->data['baseurl']}images/admin/icons/arrow_down_mini.gif" width="16" height="16" align="absmiddle" /></th>
    	<th>操作</th>
    </tr>
</thead>
<tbody>
	{if !empty($this->data['data']['rows'])}
	<!--{loop $this->data['data']['rows'] $info}-->
	<tr>
    	<td><input type="checkbox" name="id[]" option='hotkey' value="{$info['id']}" />{$info['id']}</td>
    	<td>{$info['name']}</td>
    	<td>{if $info['category']}<a href="{url('Hotkey','Index',array('cid'=>$info['category']['id']))}">{$info['category']['name']}({$info['category']['id']})</a>{/if}</td>
        <td>{$info['orderby']}</td>
        <td><a href="{url('Hotkey','Edit',array('id'=>$info['id']))}">编辑</a> | <a href="{url('Hotkey','Del',array('id'=>$info['id']))}" onclick="return confirm('确定要删除么？');">删除</a></td>
    </tr>
    <!--{/loop}-->
    <tr>
    <td colspan="5">
    <input type="radio" name="op" value="del">删除
    <input type="submit" value="执行"  onclick="return confirm('您确定执行的操作吗?');">
    </td>
    </tr>
    {/if}
</tbody>
</table>
<div id="pager">
{$this->data['pages']}
</div>
</form>
</div>
</div>